package InnerClass.InnerClassDemo006;

/**
 * ClassName:Outer
 * Package:InnerClass.InnerClassDemo006
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/26-1:53
 * @Version:v1.0
 */
public class Outer {
    int b = 20;

    public void show() {
        int a = 10;
//        public int b = 20;
        //局部内部类
        class Inner {
            String name;
            int age;

            public void method001() {
                System.out.println(a);
                System.out.println(b);
                System.out.println("局部内部类中的method001方法");
            }

            public static void method002() {
                System.out.println("局部内部类中的method002静态方法");
            }
        }
        //创建局部内部类的对象
        Inner i = new Inner();
//        i.name="张鑫";
        System.out.println(i.name);
        System.out.println(i.age);
        i.method001();
        Inner.method002();
    }
}
